/*   1:    */ package org.jetbrains.jps.model.java.impl.compiler;
/*   2:    */ 
/*   3:    */

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.JpsElementChildRole;
import org.jetbrains.jps.model.ex.JpsCompositeElementBase;
import org.jetbrains.jps.model.ex.JpsElementChildRoleBase;
import org.jetbrains.jps.model.java.compiler.JpsCompilerExcludes;
import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerConfiguration;
import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions;
import org.jetbrains.jps.model.java.compiler.ProcessorConfigProfile;
import org.jetbrains.jps.model.module.JpsModule;

import java.io.File;
import java.util.*;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */
/*  15:    */
/*  16:    */
/*  17:    */
/*  18:    */
/*  19:    */
/*  20:    */
/*  21:    */ 
/*  22:    */ public class JpsJavaCompilerConfigurationImpl
/*  23:    */   extends JpsCompositeElementBase<JpsJavaCompilerConfigurationImpl>
/*  24:    */   implements JpsJavaCompilerConfiguration
/*  25:    */ {
/*  26: 36 */   public static final JpsElementChildRole<JpsJavaCompilerConfiguration> ROLE = JpsElementChildRoleBase.create("compiler configuration");
/*  27: 37 */   private boolean a = true;
/*  28: 38 */   private boolean b = true;
/*  29: 39 */   private final JpsCompilerExcludes c = new JpsCompilerExcludesImpl();
/*  30: 40 */   private final List<String> d = new ArrayList();
/*  31: 41 */   private final List<ProcessorConfigProfile> e = new ArrayList();
/*  32: 42 */   private final ProcessorConfigProfileImpl f = new ProcessorConfigProfileImpl("Default");
/*  33:    */   private String g;
/*  34: 44 */   private final Map<String, String> h = new HashMap();
/*  35: 45 */   private final Map<String, JpsJavaCompilerOptions> i = new HashMap();
/*  36: 46 */   private String j = "Javac";
/*  37:    */   private Map<JpsModule, ProcessorConfigProfile> k;
/*  38:    */   private ResourcePatterns l;
/*  39:    */   
/*  40:    */   public JpsJavaCompilerConfigurationImpl() {}
/*  41:    */   
/*  42:    */   private JpsJavaCompilerConfigurationImpl(JpsJavaCompilerConfigurationImpl paramJpsJavaCompilerConfigurationImpl)
/*  43:    */   {
/*  44: 54 */     super(paramJpsJavaCompilerConfigurationImpl);
/*  45:    */   }
/*  46:    */   
/*  47:    */   @NotNull
/*  48:    */   public JpsJavaCompilerConfigurationImpl createCopy()
/*  49:    */   {
/*  50: 60 */     void tmp8_5 = new JpsJavaCompilerConfigurationImpl(this);
/*  51: 60 */     if (tmp8_5 == null) {
/*  52: 60 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "createCopy" }));
/*  53:    */     }
/*  54: 60 */     return tmp8_5;
/*  55:    */   }
/*  56:    */   
/*  57:    */   public boolean isAddNotNullAssertions()
/*  58:    */   {
/*  59: 65 */     return this.a;
/*  60:    */   }
/*  61:    */   
/*  62:    */   public boolean isClearOutputDirectoryOnRebuild()
/*  63:    */   {
/*  64: 70 */     return this.b;
/*  65:    */   }
/*  66:    */   
/*  67:    */   public void setAddNotNullAssertions(boolean paramBoolean)
/*  68:    */   {
/*  69: 75 */     this.a = paramBoolean;
/*  70:    */   }
/*  71:    */   
/*  72:    */   public void setClearOutputDirectoryOnRebuild(boolean paramBoolean)
/*  73:    */   {
/*  74: 80 */     this.b = paramBoolean;
/*  75:    */   }
/*  76:    */   
/*  77:    */   @NotNull
/*  78:    */   public JpsCompilerExcludes getCompilerExcludes()
/*  79:    */   {
/*  80: 86 */     JpsCompilerExcludes tmp4_1 = this.c;
/*  81: 86 */     if (tmp4_1 == null) {
/*  82: 86 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "getCompilerExcludes" }));
/*  83:    */     }
/*  84: 86 */     return tmp4_1;
/*  85:    */   }
/*  86:    */   
/*  87:    */   @NotNull
/*  88:    */   public ProcessorConfigProfile getDefaultAnnotationProcessingProfile()
/*  89:    */   {
/*  90: 92 */     ProcessorConfigProfileImpl tmp4_1 = this.f;
/*  91: 92 */     if (tmp4_1 == null) {
/*  92: 92 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "getDefaultAnnotationProcessingProfile" }));
/*  93:    */     }
/*  94: 92 */     return tmp4_1;
/*  95:    */   }
/*  96:    */   
/*  97:    */   @NotNull
/*  98:    */   public Collection<ProcessorConfigProfile> getAnnotationProcessingProfiles()
/*  99:    */   {
/* 100: 98 */     List tmp4_1 = this.e;
/* 101: 98 */     if (tmp4_1 == null) {
/* 102: 98 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "getAnnotationProcessingProfiles" }));
/* 103:    */     }
/* 104: 98 */     return tmp4_1;
/* 105:    */   }
/* 106:    */   
/* 107:    */   public void addResourcePattern(String paramString)
/* 108:    */   {
/* 109:103 */     this.d.add(paramString);
/* 110:    */   }
/* 111:    */   
/* 112:    */   public List<String> getResourcePatterns()
/* 113:    */   {
/* 114:108 */     return this.d;
/* 115:    */   }
/* 116:    */   
/* 117:    */   public boolean isResourceFile(@NotNull File paramFile1, @NotNull File paramFile2)
/* 118:    */   {
/* 119:113 */     if (paramFile1 == null) {
/* 120:113 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "isResourceFile" }));
/* 121:    */     }
/* 122:113 */     if (paramFile2 == null) {
/* 123:113 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "isResourceFile" }));
/* 124:    */     }
/* 125:113 */     ResourcePatterns localResourcePatterns = this.l;
/* 126:114 */     if (localResourcePatterns == null) {
/* 127:115 */       this.l = (localResourcePatterns = new ResourcePatterns(this));
/* 128:    */     }
/* 129:117 */     return localResourcePatterns.isResourceFile(paramFile1, paramFile2);
/* 130:    */   }
/* 131:    */   
/* 132:    */   @Nullable
/* 133:    */   public String getByteCodeTargetLevel(String paramString)
/* 134:    */   {
/* 135:123 */     String str = (String)this.h.get(paramString);
/* 136:124 */     if (str != null) {
/* 137:125 */       return str.isEmpty() ? null : str;
/* 138:    */     }
/* 139:127 */     return this.g;
/* 140:    */   }
/* 141:    */   
/* 142:    */   public void setModuleByteCodeTargetLevel(String paramString1, String paramString2)
/* 143:    */   {
/* 144:132 */     this.h.put(paramString1, paramString2);
/* 145:    */   }
/* 146:    */   
/* 147:    */   @NotNull
/* 148:    */   public String getJavaCompilerId()
/* 149:    */   {
/* 150:138 */     String tmp4_1 = this.j;
/* 151:138 */     if (tmp4_1 == null) {
/* 152:138 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "getJavaCompilerId" }));
/* 153:    */     }
/* 154:138 */     return tmp4_1;
/* 155:    */   }
/* 156:    */   
/* 157:    */   public void setJavaCompilerId(@NotNull String paramString)
/* 158:    */   {
/* 159:143 */     if (paramString == null) {
/* 160:143 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "setJavaCompilerId" }));
/* 161:    */     }
/* 162:143 */     this.j = paramString;
/* 163:    */   }
/* 164:    */   
/* 165:    */   @NotNull
/* 166:    */   public JpsJavaCompilerOptions getCompilerOptions(@NotNull String paramString)
/* 167:    */   {
/* 168:149 */     if (paramString == null) {
/* 169:149 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "getCompilerOptions" }));
/* 170:    */     }
/* 171:149 */     JpsJavaCompilerOptions localJpsJavaCompilerOptions = (JpsJavaCompilerOptions)this.i.get(paramString);
/* 172:150 */     if (localJpsJavaCompilerOptions == null)
/* 173:    */     {
/* 174:151 */       localJpsJavaCompilerOptions = new JpsJavaCompilerOptions();
/* 175:152 */       this.i.put(paramString, localJpsJavaCompilerOptions);
/* 176:    */     }
/* 177:154 */     JpsJavaCompilerOptions tmp79_78 = localJpsJavaCompilerOptions;
/* 178:154 */     if (tmp79_78 == null) {
/* 179:154 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "getCompilerOptions" }));
/* 180:    */     }
/* 181:154 */     return tmp79_78;
/* 182:    */   }
/* 183:    */   
/* 184:    */   public void setCompilerOptions(@NotNull String paramString, @NotNull JpsJavaCompilerOptions paramJpsJavaCompilerOptions)
/* 185:    */   {
/* 186:159 */     if (paramString == null) {
/* 187:159 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "setCompilerOptions" }));
/* 188:    */     }
/* 189:159 */     if (paramJpsJavaCompilerOptions == null) {
/* 190:159 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "setCompilerOptions" }));
/* 191:    */     }
/* 192:159 */     this.i.put(paramString, paramJpsJavaCompilerOptions);
/* 193:    */   }
/* 194:    */   
/* 195:    */   @NotNull
/* 196:    */   public JpsJavaCompilerOptions getCurrentCompilerOptions()
/* 197:    */   {
/* 198:165 */     JpsJavaCompilerOptions tmp8_5 = getCompilerOptions(getJavaCompilerId());
/* 199:165 */     if (tmp8_5 == null) {
/* 200:165 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "getCurrentCompilerOptions" }));
/* 201:    */     }
/* 202:165 */     return tmp8_5;
/* 203:    */   }
/* 204:    */   
/* 205:    */   public void setProjectByteCodeTargetLevel(String paramString)
/* 206:    */   {
/* 207:170 */     this.g = paramString;
/* 208:    */   }
/* 209:    */   
/* 210:    */   public ProcessorConfigProfile addAnnotationProcessingProfile()
/* 211:    */   {
/* 212:175 */     ProcessorConfigProfileImpl localProcessorConfigProfileImpl = new ProcessorConfigProfileImpl("");
/* 213:176 */     this.e.add(localProcessorConfigProfileImpl);
/* 214:177 */     return localProcessorConfigProfileImpl;
/* 215:    */   }
/* 216:    */   
/* 217:    */   @NotNull
/* 218:    */   public ProcessorConfigProfile getAnnotationProcessingProfile(JpsModule paramJpsModule)
/* 219:    */   {
/* 220:183 */     Object localObject1 = this.k;
/* 221:184 */     if (localObject1 == null)
/* 222:    */     {
/* 223:185 */       localObject1 = new HashMap();
/* 224:186 */       localObject2 = new HashMap();
/* 225:187 */       for (Iterator localIterator1 = paramJpsModule.getProject().getModules().iterator(); localIterator1.hasNext();)
/* 226:    */       {
/* 227:187 */         localObject3 = (JpsModule)localIterator1.next();
/* 228:188 */         ((Map)localObject2).put(((JpsModule)localObject3).getName(), localObject3);
/* 229:    */       }
/* 230:    */       Object localObject3;
/* 231:190 */       if (!((Map)localObject2).isEmpty()) {
/* 232:191 */         for (localIterator1 = getAnnotationProcessingProfiles().iterator(); localIterator1.hasNext();)
/* 233:    */         {
/* 234:191 */           localObject3 = (ProcessorConfigProfile)localIterator1.next();
/* 235:192 */           for (String str : ((ProcessorConfigProfile)localObject3).getModuleNames())
/* 236:    */           {
/* 237:193 */             JpsModule localJpsModule = (JpsModule)((Map)localObject2).get(str);
/* 238:194 */             if (localJpsModule != null) {
/* 239:195 */               ((Map)localObject1).put(localJpsModule, localObject3);
/* 240:    */             }
/* 241:    */           }
/* 242:    */         }
/* 243:    */       }
/* 244:200 */       this.k = ((Map)localObject1);
/* 245:    */     }
/* 246:202 */     Object localObject2 = (ProcessorConfigProfile)((Map)localObject1).get(paramJpsModule); Object 
/* 247:203 */       tmp225_222 = (localObject2 != null ? localObject2 : getDefaultAnnotationProcessingProfile());
/* 248:203 */     if (tmp225_222 == null) {
/* 249:203 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/java/impl/compiler/JpsJavaCompilerConfigurationImpl", "getAnnotationProcessingProfile" }));
/* 250:    */     }
/* 251:203 */     return tmp225_222;
/* 252:    */   }
/* 253:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.java.impl.compiler.JpsJavaCompilerConfigurationImpl

 * JD-Core Version:    0.7.0.1

 */